<template>
  <el-dialog
    :title="title"
    :visible.sync="dialogFormVisible"
    width="500px"
    :before-close="handleClose"
  >
    <div class="result-content">
      <div class="result-icon">
        <img :src="img" alt="result" style="width: 80px; height: 80px;" />
      </div>
      <div class="result-text">
        <h3>{{ content }}</h3>
        <p>{{ bottomTxt }}</p>
      </div>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button type="primary" @click="handleConfirm" class="light-green-btn">
        确定
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "orderResult",
  props: {
    title: {
      type: String,
      default: "提示"
    },
    content: {
      type: String,
      default: ""
    },
    bottomTxt: {
      type: String,
      default: ""
    },
    img: {
      type: String,
      default: "@/assets/imgs/head.gif"
    },
    dialogFormVisible: {
      type: Boolean,
      default: false
    }
  },
  methods: {
    handleClose() {
      this.$emit("changeComfromDialogVisible", false);
    },
    handleConfirm() {
      this.$emit("changeComfromDialogVisible", true);
    }
  }
};
</script>

<style lang="scss" scoped>
.result-content {
  text-align: center;
  padding: 20px;
}

.result-icon {
  margin-bottom: 20px;
}

.result-text h3 {
  color: #26a872;
  margin-bottom: 10px;
  font-size: 16px;
}

.result-text p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}
</style>